package com.ywt.cda.action;

import java.io.PrintWriter;
import java.math.BigDecimal;
import java.util.*;

import javax.annotation.Resource;

import com.ywt.cda.access.Access;
import com.ywt.cda.action.model.BaseParamModel;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.ywt.cda.action.model.AreaModel;
import com.ywt.cda.action.model.GoodsModel;
import com.ywt.cda.domain.Ana1stData;
import com.ywt.cda.domain.Ana2ndData;
import com.ywt.cda.domain.AnaImportData;
import com.ywt.cda.domain.enums.DimensionFlag;
import com.ywt.cda.domain.enums.OrderByEnum;
import com.ywt.cda.domain.enums.SexEnum;
import com.ywt.cda.enums.FunctionsEnum;
import com.ywt.cda.service.AreaService;
import com.ywt.cda.service.GoodsService;
import com.ywt.cda.service.ParamValidateService;
import com.ywt.cda.utils.DateUtils;
import com.ywt.cda.utils.NumberUtil;

/**
 * （地域分析）
 * <br>（功能详细描述）
 *
 * @author lougf
 * @version V1.0
 * @see [相关类/方法]
 * @since 2016年3月16日 上午10:06:08
 */
@Controller
public class AreaAction {

    private Logger logger = Logger.getLogger(AreaAction.class);

    @Resource
    private ParamValidateService paramValidateService;
    @Resource
    private AreaService areaService;
    @Resource
    private GoodsService goodsService;

    /**
     * 出口-地域分析 getExportAreaAnalyze(这里用一句话描述这个方法的作用) <br>
     * (这里描述这个方法适用条件 – 可选)
     *
     * @param areaModel
     * @param model
     * @return
     * @throws
     * @author lougf
     * @since 2016-3-11 下午1:57:55
     */
    @RequestMapping("export/area")
    @Access(FunctionsEnum.EXPORT_AREA)
    public String getExportAreaAnalyze(
            @ModelAttribute("areaModel") GoodsModel areaModel,
            Model model) {
        if (null == areaModel) {
            // 默认查近七天
            areaModel = new GoodsModel();
            Date date = new Date();
            String today = DateUtils.format(date, "yyyy-MM-dd");
            areaModel.setStartTime(DateUtils.getSpecifiedDayBefore(
                    today, 6));
            areaModel.setEndTime(today);
            model.addAttribute("default", true);
        }
        if (null != areaModel) {
            if (StringUtils.isBlank(areaModel.getStartTime())
                    && StringUtils.isBlank(areaModel.getEndTime())) {
                // 默认查近七天

                Date date = new Date();
                String today = DateUtils.format(date, "yyyy-MM-dd");
                areaModel.setStartTime(DateUtils.getSpecifiedDayBefore(
                        today, 6));
                areaModel.setEndTime(today);
                model.addAttribute("default", true);
            }
        }

        // 第一步：校验输入参数
        if (!paramValidateService.validate(areaModel)) {
            logger.info("error param!");
            model.addAttribute("error", "error param!");
            return "error";
        }

        //出口走势
        Date starttime = DateUtils.getDate(areaModel.getStartTime(), "yyyy-MM-dd");
        Date endtime = DateUtils.getDate(areaModel.getEndTime(), "yyyy-MM-dd");

        Integer days =  DateUtils.daysBetween(starttime,endtime);
       if(days > 150){
            areaModel.setStartTime_F(DateUtils.format(starttime,"yyyy-MM"));
            areaModel.setEndTime_F(DateUtils.format(endtime,"yyyy-MM"));
            areaModel.setStartTimePattern("yyyy-MM");
        }
        List<Ana1stData> datas2 =  areaService.queryExportData_1ST(areaModel);
        model.addAttribute("datas2", generateZeroDateByTime(areaModel,datas2));

        // 国家销售数量排名
        List<Ana2ndData> datas3 = areaService.getTopNAreaData(
                areaModel, 300, OrderByEnum.SUM_NUM, DimensionFlag.EXPORT_COUNTRY);
        areaService.initDataMainName(datas3, DimensionFlag.EXPORT_COUNTRY);
        model.addAttribute("datas3", datas3);
        // 第三步：组装数据
        JSONArray result = new JSONArray();
        areaService.toJsonArray(datas3, result, OrderByEnum.SUM_NUM);
        model.addAttribute("htmlText", result.toJSONString().replaceAll("\"name\"","name").replaceAll("\"value\"","value").replaceAll("\"","\'"));
        //地图最大值
        model.addAttribute("levelvalue", null !=datas3 && datas3.size() >0?(datas3.get(0).getSumNum().intValue()+10000):10000);


        model.addAttribute("yes", areaModel.getSelectButton());
        model.addAttribute("days",days);
        return "export/area";
    }
    
    

    /**
     * 
     * getImportArea(进口地域分析 )
     * <br>(这里描述这个方法适用条件 – 可选)
     * @param model
     * @return 
     * @exception 
     * @since 2016年3月22日 上午10:41:13
     * @author lougf
     */
    @RequestMapping("import/area")
    @Access(FunctionsEnum.IMPORT_AREA)
    public String getImportArea(
            @ModelAttribute("areaModel") AreaModel areaModel,
            Model model) {
        if (null == areaModel) {

            // 默认查近七天
            areaModel = new AreaModel();
            Date date = new Date();
            String today = DateUtils.format(date, "yyyy-MM-dd");
            areaModel.setStartTime(DateUtils.getSpecifiedDayBefore(
                    today, 6));
            areaModel.setEndTime(today);
            model.addAttribute("default", true);
        }
        if (null != areaModel) {
            if (StringUtils.isBlank(areaModel.getStartTime())
                    && StringUtils.isBlank(areaModel.getEndTime())) {
                // 默认查近七天

                Date date = new Date();
                String today = DateUtils.format(date, "yyyy-MM-dd");
                areaModel.setStartTime(DateUtils.getSpecifiedDayBefore(
                        today, 6));
                areaModel.setEndTime(today);
                model.addAttribute("default", true);
            }
        }

        // 第一步：校验输入参数
        if (!paramValidateService.validate(areaModel)) {
            logger.info("error param!");
            model.addAttribute("error", "error param!");
            return "error";
        }


        model.addAttribute("yes", areaModel.getSelectButton());
        return "import/area";
    	
    }



    @RequestMapping("import/areaAnalyze")
    public String getImportAreaAnalyze(
            @ModelAttribute("areaModel") GoodsModel importGoodsModel,
            Model model) {
        if (null == importGoodsModel) {

            // 默认查近七天
            importGoodsModel = new GoodsModel();
            Date date = new Date();
            String today = DateUtils.format(date, "yyyy-MM-dd");
            importGoodsModel.setStartTime(DateUtils.getSpecifiedDayBefore(
                    today, 6));
            importGoodsModel.setEndTime(today);
            model.addAttribute("default", true);
        }
        if (null != importGoodsModel) {
            if (StringUtils.isBlank(importGoodsModel.getStartTime())
                    && StringUtils.isBlank(importGoodsModel.getEndTime())) {
                // 默认查近七天

                Date date = new Date();
                String today = DateUtils.format(date, "yyyy-MM-dd");
                importGoodsModel.setStartTime(DateUtils.getSpecifiedDayBefore(
                        today, 6));
                importGoodsModel.setEndTime(today);
                model.addAttribute("default", true);
            }
        }

        // 第一步：校验输入参数
        if (!paramValidateService.validate(importGoodsModel)) {
            logger.info("error param!");
            model.addAttribute("error", "error param!");
            return "error";
        }
        Date starttime = DateUtils.getDate(importGoodsModel.getStartTime(), "yyyy-MM-dd");
        Date endtime = DateUtils.getDate(importGoodsModel.getEndTime(), "yyyy-MM-dd");

        Integer days =  DateUtils.daysBetween(starttime,endtime);
        if(days > 150){
            importGoodsModel.setStartTime_F(DateUtils.format(starttime,"yyyy-MM"));
            importGoodsModel.setEndTime_F(DateUtils.format(endtime,"yyyy-MM"));
            importGoodsModel.setStartTimePattern("yyyy-MM");
        }
        // 第二步：进行数据库查询
        // 根据省份查询销售数量，客单价排名
        List<AnaImportData> datas2 =  goodsService.getGoodsImortDataByDateFlag(importGoodsModel, importGoodsModel.getProvince(),null);

        Collections.reverse(datas2);
        model.addAttribute("datas2",  generateImportZeroDateByTime(importGoodsModel,datas2));
        //计算均价(总金额除以总数量)
        model.addAttribute("avgprice", "0");
        model.addAttribute("sumnum", "0");
        model.addAttribute("scale", "0");
        if(null != datas2 && datas2.size() > 0){
            BigDecimal allSumNum = new BigDecimal(new Double("0"));
            BigDecimal allSumPrice = new BigDecimal(new Double("0"));
            for(AnaImportData data : datas2){
                if(null != data.getSumPrice()){
                    allSumPrice = allSumPrice.add(data.getSumPrice()) ;
                }
                if(null != data.getSumNum()){
                    allSumNum = allSumNum.add(data.getSumNum()) ;
                }
            }
            model.addAttribute("sumnum", allSumNum.toString());
            model.addAttribute("avgprice", String.valueOf(NumberUtil.div(allSumPrice.doubleValue(),allSumNum.doubleValue(),2)));
            Long sumNum = goodsService.getAllProvinceSumNum(importGoodsModel,importGoodsModel.getKeywordCode());
            model.addAttribute("scale",NumberUtil.mul(NumberUtil.div(allSumNum.doubleValue(),new Double(String.valueOf(null ==sumNum?0l:sumNum)),4),new Double("100")));

        }
        // 根据省份查询来源国排名
        List<AnaImportData> datas3 =  goodsService.getGoodsImortDataByCountry(importGoodsModel, importGoodsModel.getProvince(),null);
        areaService.initImportDataMainName(datas3, DimensionFlag.EXPORT_COUNTRY);
        // 根据省份查询品类排名
        List<AnaImportData> datas4 =  goodsService.getGoodsImortDataByCategory(importGoodsModel, importGoodsModel.getProvince(),null);
        goodsService.initImportDataMainName(datas4, DimensionFlag.S_CATEGORY);
        model.addAttribute("datas3", datas3);
        model.addAttribute("datas4", datas4);

        //计算平均购买次数   男女比例  平均购买单价
        model.addAttribute("avgcount", "0");
        List<AnaImportData> datas5 =  goodsService.getGoodsImortDataBySex(importGoodsModel, importGoodsModel.getProvince(),null);
        model.addAttribute("womanscale", "0");
        model.addAttribute("manscale", "0");
        if(null != datas5 && datas5.size() > 0){
            BigDecimal allCountNum = new BigDecimal(new Double("0"));
            BigDecimal allSumNum = new BigDecimal(new Double("0"));
            BigDecimal manCountNum =  new BigDecimal(new Double("0"));
            BigDecimal womanCountNum =  new BigDecimal(new Double("0"));
            for(AnaImportData data : datas5){
                if(null != data.getMainCodeCount()){
                    allCountNum = allCountNum.add(data.getMainCodeCount()) ;
                }
                if(null != data.getSumNum()){
                    allSumNum = allSumNum.add(data.getSumNum()) ;
                }
                if(data.getSecondCode().endsWith(SexEnum.M.name())){
                    manCountNum = data.getMainCodeCount();
                }else  if(data.getSecondCode().endsWith(SexEnum.F.name())){
                    womanCountNum = data.getMainCodeCount();
                }
            }
            model.addAttribute("womanscale",NumberUtil.mul(NumberUtil.div(womanCountNum.doubleValue(),allCountNum.doubleValue(),2),new Double("100")));
            model.addAttribute("manscale",NumberUtil.mul(NumberUtil.div(manCountNum.doubleValue(),allCountNum.doubleValue(),2),new Double("100")));
            model.addAttribute("avgcount", String.valueOf(NumberUtil.div(allSumNum.doubleValue(),allCountNum.doubleValue(),2)));


        }
        //根据生日计算年龄分布
        List<AnaImportData> datas6 =  goodsService.getGoodsImortDataByAge(importGoodsModel, importGoodsModel.getProvince(),null);
        Long before19 = 0l;//18岁以下
        Long before26up18 = 0l;//18岁以上26以下
        Long before36up25 = 0l;//25岁以上35以下
        Long before46up35 = 0l;//35岁以上46以下
        Long up45 = 0l;//45岁以上
        Long max = 5l;
        if(null != datas6 && datas6.size() > 0){
            Integer nowyear =  Integer.parseInt(DateUtils.format("yyyy"));
            for(AnaImportData data : datas6){
                try {
                    Integer year =  nowyear - Integer.parseInt(data.getSecondCode());
                    if(year <= 18){
                        before19 = before19+data.getMainCodeCount().longValue();
                    }else if(year >= 19 && year < 26 ){
                        before26up18 = before26up18+data.getMainCodeCount().longValue();

                    }else if(year >= 26 && year < 36 ){
                        before36up25 = before36up25+data.getMainCodeCount().longValue();

                    }else if(year >= 36 &&year < 46 ){
                        before46up35 = before46up35+data.getMainCodeCount().longValue();

                    }else{
                        up45 = up45+data.getMainCodeCount().longValue();

                    }
                } catch (Exception e) {

                }
            }
        }

        model.addAttribute("before19", before19);
        model.addAttribute("before26up18", before26up18);
        model.addAttribute("before36up25", before36up25);
        model.addAttribute("before46up35", before46up35);
        model.addAttribute("up45", up45);
        model.addAttribute("max",  max+before19+before26up18+before36up25+before46up35+up45);
        //获取最多年龄段
        model.addAttribute("mostmax", NumberUtil.searchMaxWithIndex(new Long[]{before19,before26up18,before36up25,before46up35,up45})[0]);
        // 第三步：组装数据
        JSONArray result = new JSONArray();
        areaService.toJsonArrayImport(datas3, result, OrderByEnum.SUM_NUM);
        model.addAttribute("htmlText", result.toJSONString().replaceAll("\"name\"","name").replaceAll("\"value\"","value").replaceAll("\"","\'"));
        //地图最大值
        model.addAttribute("levelvalue", null !=datas3 && datas3.size() >0?(datas3.get(0).getSumNum().intValue()+10000):10000);
        model.addAttribute("keywordCode", importGoodsModel.getKeywordCode());
        model.addAttribute("province", importGoodsModel.getProvince());
        model.addAttribute("days", days);
        //判断是否最近日期
        model.addAttribute("isNow", DateUtils.format(importGoodsModel.getStartTimePattern()).equals(importGoodsModel.getEndTime_F()));
        model.addAttribute("startTime_F", importGoodsModel.getStartTime_F());
        model.addAttribute("endTime_F", importGoodsModel.getEndTime_F());
        return "import/areaAnalyze";

    }


    /**
     * 时间区间无数据的补全0数据
     */
    private List<Ana1stData>  generateZeroDateByTime(BaseParamModel  model,List<Ana1stData> data){
        List<Ana1stData> newDate = new ArrayList<Ana1stData>();
        Map<String,Ana1stData>  temp = new HashMap<String,Ana1stData>();
        if(null != data){
            for(Ana1stData ana1stData : data){
                temp.put(ana1stData.getDateFlag(),ana1stData);
            }
        }

        List<String>  timeList = DateUtils.getDateList(model.getStartTime_F(),model.getEndTime_F());
        for(String time : timeList){
           if(temp.containsKey(time)){
               newDate.add(temp.get(time));
           }else{
               Ana1stData tempAna1stData = new Ana1stData();
               tempAna1stData.setDateFlag(time);
               tempAna1stData.setSumNum(new BigDecimal(0));
               tempAna1stData.setAvgPrice(new BigDecimal(0));
               newDate.add(tempAna1stData);

           }
        }
        return  newDate;
    }



    private List<AnaImportData>  generateImportZeroDateByTime(BaseParamModel  model,List<AnaImportData> data){
        List<AnaImportData> newDate = new ArrayList<AnaImportData>();
        Map<String,AnaImportData>  temp = new HashMap<String,AnaImportData>();
        if(null != data){
            for(AnaImportData ana1stData : data){
                temp.put(ana1stData.getDateFlag(),ana1stData);
            }
        }

        List<String>  timeList = DateUtils.getDateList(model.getStartTime_F(),model.getEndTime_F());
        for(String time : timeList){
            if(temp.containsKey(time)){
                newDate.add(temp.get(time));
            }else{
                AnaImportData tempAna1stData = new AnaImportData();
                tempAna1stData.setDateFlag(time);
                tempAna1stData.setSumNum(new BigDecimal(0));
                tempAna1stData.setAvgPrice(new BigDecimal(0));
                newDate.add(tempAna1stData);

            }
        }
        return  newDate;
    }
    
    @RequestMapping("import/theArea")
    @Access(FunctionsEnum.IMPORT_THEAREA)
    public String getImportTheArea(@ModelAttribute("goodsModel") GoodsModel importGoodsModel,
            Model model){
    	if (null == importGoodsModel) {

            // 默认查近七天
            importGoodsModel = new GoodsModel();
            Date date = new Date();
            String today = DateUtils.format(date, "yyyy-MM-dd");
            importGoodsModel.setStartTime(DateUtils.getSpecifiedDayBefore(
                    today, 6));
            importGoodsModel.setEndTime(today);
            model.addAttribute("default", true);
        }
        if (null != importGoodsModel) {
            if (StringUtils.isBlank(importGoodsModel.getStartTime())
                    && StringUtils.isBlank(importGoodsModel.getEndTime())) {
                // 默认查近七天

                Date date = new Date();
                String today = DateUtils.format(date, "yyyy-MM-dd");
                importGoodsModel.setStartTime(DateUtils.getSpecifiedDayBefore(
                        today, 6));
                importGoodsModel.setEndTime(today);
                model.addAttribute("default", true);
            }
        }
        // 第一步：校验输入参数
        if (!paramValidateService.validate(importGoodsModel)) {
            logger.info("error param!");
            model.addAttribute("error", "error param!");
            return "error";
        }
        /*Date starttime = DateUtils.getDate(importGoodsModel.getStartTime(), "yyyy-MM-dd");
        Date endtime = DateUtils.getDate(importGoodsModel.getEndTime(), "yyyy-MM-dd");

        Integer days =  DateUtils.daysBetween(starttime,endtime);
        if(days > 150){
            importGoodsModel.setStartTime_F(DateUtils.format(starttime,"yyyy-MM"));
            importGoodsModel.setEndTime_F(DateUtils.format(endtime,"yyyy-MM"));
            importGoodsModel.setStartTimePattern("yyyy-MM");
        }*/
        // 第二步：进行数据库查询
        //根据查询时间获取所有品类排名
        /*List<AnaImportData> datas1 = goodsService.getTopNGoodsImortData(importGoodsModel, 10, OrderByEnum.SUM_NUM,DimensionFlag.S_CATEGORY);
		goodsService.initImportDataMainName(datas1, DimensionFlag.S_CATEGORY);
        model.addAttribute("datas1", datas1);*/
        
    	return "import/theArea";
    }
    
    @RequestMapping("import/getTheAreaData")
	public void getJson( GoodsModel importGoodsModel,PrintWriter out) {
		JSONObject object = new JSONObject();
		if (null == importGoodsModel) 
		{
			// 默认查近七天
			importGoodsModel = new GoodsModel();
			Date date = new Date();
			String today = DateUtils.format(date, "yyyy-MM-dd");
			importGoodsModel.setStartTime(DateUtils.getSpecifiedDayBefore(today, 6));
			importGoodsModel.setEndTime(today);
		}
		if (null != importGoodsModel) {
			if (StringUtils.isBlank(importGoodsModel.getStartTime()) && StringUtils.isBlank(importGoodsModel.getEndTime())) 
			{
				// 默认查近七天
				Date date = new Date();
				String today = DateUtils.format(date, "yyyy-MM-dd");
				importGoodsModel.setStartTime(DateUtils.getSpecifiedDayBefore(today, 6));
				importGoodsModel.setEndTime(today);
			}
		}
		// 第一步：校验输入参数
		if (!paramValidateService.validate(importGoodsModel)) 
		{
			logger.info("error param!");
			object.put("success", false);
			object.put("message", "参数错误");
			out.print(object.toJSONString());
			return;
		}
		JSONObject objectTheAreaData = new JSONObject();
		//根据查询时间获取所有品类排名
        /*List<AnaImportData> datas1 = goodsService.getTopNGoodsImortData(importGoodsModel, 100, OrderByEnum.SUM_NUM,DimensionFlag.S_CATEGORY);
		goodsService.initImportDataMainName(datas1, DimensionFlag.S_CATEGORY);*/
		//根据品类计算省份排名
        List<AnaImportData> datas2 =  goodsService.getImportDataByCode(importGoodsModel,importGoodsModel.getCategory(),DimensionFlag.PROVINCE_TYPE.getCode());
        areaService.initImportDataMainName(datas2, DimensionFlag.PROVINCE_TYPE);
        //根据品类计算来源国排名
        List<AnaImportData> datas3 =  goodsService.getImportDataByCode(importGoodsModel,importGoodsModel.getCategory(),DimensionFlag.EXPORT_COUNTRY.getCode());
        areaService.initImportDataMainName(datas3, DimensionFlag.EXPORT_COUNTRY);
        // 第三步：组装数据
        /*JSONArray result1 = new JSONArray();
        areaService.toJsonArrayImport(datas1, result1, OrderByEnum.SUM_NUM);
        objectTheAreaData.put("result1", result1);*/
        
        JSONArray result2 = new JSONArray();
        areaService.toJsonArrayImport(datas2, result2, OrderByEnum.SUM_NUM);
        objectTheAreaData.put("result2", result2);
        
        JSONArray result3 = new JSONArray();
        areaService.toJsonArrayImport(datas3, result3, OrderByEnum.SUM_NUM);
        //地图最大值
        objectTheAreaData.put("max", null !=datas2 && datas2.size() >0?(datas2.get(0).getSumNum().intValue()+1000):1000);
        objectTheAreaData.put("levelvalue", null !=datas3 && datas3.size() >0?(datas3.get(0).getSumNum().intValue()+5000):5000);
        objectTheAreaData.put("keywordCode", importGoodsModel.getKeywordCode());
        objectTheAreaData.put("province", importGoodsModel.getProvince());
        //判断是否最近日期
        objectTheAreaData.put("isNow", DateUtils.format(importGoodsModel.getStartTimePattern()).equals(importGoodsModel.getEndTime_F()));
        objectTheAreaData.put("startTime_F", importGoodsModel.getStartTime_F());
        objectTheAreaData.put("endTime_F", importGoodsModel.getEndTime_F());
        objectTheAreaData.put("result3", result3);
        
        
		object.put("objectTheAreaData", objectTheAreaData);
		object.put("success", true);
		out.print(object.toJSONString());
    
	}
    
    
    @RequestMapping("import/getDatas1")
	public void getJson1( GoodsModel importGoodsModel,PrintWriter out) {
		JSONObject object = new JSONObject();
		if (null == importGoodsModel) 
		{
			// 默认查近七天
			importGoodsModel = new GoodsModel();
			Date date = new Date();
			String today = DateUtils.format(date, "yyyy-MM-dd");
			importGoodsModel.setStartTime(DateUtils.getSpecifiedDayBefore(today, 6));
			importGoodsModel.setEndTime(today);
		}
		if (null != importGoodsModel) {
			if (StringUtils.isBlank(importGoodsModel.getStartTime()) && StringUtils.isBlank(importGoodsModel.getEndTime())) 
			{
				// 默认查近七天
				Date date = new Date();
				String today = DateUtils.format(date, "yyyy-MM-dd");
				importGoodsModel.setStartTime(DateUtils.getSpecifiedDayBefore(today, 6));
				importGoodsModel.setEndTime(today);
			}
		}
		// 第一步：校验输入参数
		if (!paramValidateService.validate(importGoodsModel)) 
		{
			logger.info("error param!");
			object.put("success", false);
			object.put("message", "参数错误");
			out.print(object.toJSONString());
			return;
		}
		JSONObject objectTheAreaData = new JSONObject();
		//根据查询时间获取所有品类排名
        List<AnaImportData> datas1 = goodsService.getTopNGoodsImortData(importGoodsModel, 100, OrderByEnum.SUM_NUM,DimensionFlag.S_CATEGORY);
		goodsService.initImportDataMainName(datas1, DimensionFlag.S_CATEGORY);
		
        // 第三步：组装数据
        JSONArray result1 = new JSONArray();
        areaService.toJsonArrayImport(datas1, result1, OrderByEnum.SUM_NUM);
        objectTheAreaData.put("result1", result1);
         
		object.put("objectTheAreaData", objectTheAreaData);
		object.put("success", true);
		out.print(object.toJSONString());
    
	}

}
